import Vue from 'vue'
import router from '@/router/index.js'

router.beforeEach((to, from, next) => {
    let token = localStorage.getItem('Token')
    // console.log(token);
    if(to.path == '/'){
        if(token){
            next()
        }else{
            next('/login')
        }
    }else{
        next()
    }
})